<template>
	<div>
		<div class="publish-top">
			<div class="left-icon" @click="handleBack"> 
				<img src="../../../assets/images/left.png"/>
			</div>
			<p>私信详情</p>
		</div>
		<div class="details-content">
			<div class="details-box">
				<div class="box-left">
					<img src="../../../assets/images/mine/forward.png"/>
					<p>{{time}}</p>
				</div>
				<p>主题：{{list.messages_title}}</p>
				<p class="desc">{{list.messages_desc}}</p>
			</div>
			<div class="footer" @click="handleReply(list.user_id,list.user_nickname)">回复</div>
		</div>
	</div>
</template>

<script>
	
	import axios from "axios";
	import user from '../../../utils/isLogin';
	import defalut from '../../../assets/default.jpg';
	import qs from 'qs';
	export default{
		data(){
			return{
				list:{},
				articleId:0,
				time:0,
				isClick:true
			}
		},
		filters: {
		  url: function (value) {
		    if (!value) return ''
		    value = user.src + value
		    return value
		  }
		},
		created(){
			
			var curr = plus.webview.currentWebview();
		  	this.articleId = curr.articleId;
			let plusReady = ()=>{
				
			}
			if (window.plus) {
		      plusReady();
		    } else {
		      document.addEventListener("plusready", plusReady, false);
		    }
		    
	    	axios.post(user.src + '/index/my/personal_details' , {
				messagesId: this.articleId,
			})
			.then((res)=> {
				console.log(JSON.stringify(res))
				if(res.data.status == 200){
					this.list = res.data.data;
					this.time = res.data.data.messages_time.slice(0,16);
					this.name = res.data.data.user_nickname;
				}
			})
			.catch((error)=> {
			   
			});
		},
		components:{
			
		},
		methods:{
			//返回
			handleBack(){
				var privateDetails = plus.webview.currentWebview();
				plus.webview.close(privateDetails);
			},
			handleReply(id,name){
				if(this.isClick){
					this.isClick = false;
					var send = plus.webview.create('send.html','send',{scrollIndicator:'none'},{
						recipientId:id,
						name:name
					});
					send.addEventListener("loaded", ()=> {
					    send.show('pop-in', 300);
					    this.isClick = true;
					    send = null;
					}, false);
				}
			}
		}
	}
</script>

<style lang='less' scoped>

html,body{
		padding: 0;
		margin: 0;
		width: 100%;
		height: 100%;
		background: #fff;
	}
	*{
		margin: 0;
		padding: 0;
	}
	ul,li{
		list-style: none;
	}
	.publish-top{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 60px;
		background:@default-blue;
		box-shadow: 0px 0px 8px 1px #999;
		padding-top: 70px;
		display:flex;				
		.left-icon{
			width: 90px;
			img{
				width: 15px;
				height: 26px;
				margin-left: 31px;
			}
		}
		p{		
			width: 80%;
			color: #fff;
			font-size: 28px;
			text-align: center;
		}
		span{
			display: block;
			width: 170px;
			color: #fff;
			font-size: 28px;
			text-align: center;
		}
	}
	.details-content{
		padding-top: 130px;
		width: 100%;	
		.details-box{
			padding: 30px;
			.box-left{
				display: flex;	
				img{
					margin: 0 9px 0 3px;
					display: block;
					width: 28px;
					height: 28px;
				}
				p{
					font-size: 22px;
					color: #333;
				}
			}
			p{
				margin-bottom: 20px;
				font-size: 26px;
				color: #333;
			}
			.desc{
				padding-top: 30px;
				text-indent: 2rem;
				line-height: 30px;
				font-size: 24px;
				border-top: 0.1rem solid #f6f6f6;
			}
		}
		.footer{
			position: fixed;
			bottom: 0;
			left: 0;
			width: 100%;
			height: 100px;
			line-height: 100px;
			background: #0091E4;
			font-size: 38px;
			color: #fff;
			text-align: center;
		}
	}
</style>